let couponid = getQueryString('couponid')

let ul = document.querySelector('ul')

const xhr1 = new XMLHttpRequest()
xhr1.open("get",`http://chst.vip:1234/api/getcouponproduct?couponid=${couponid}`)
xhr1.onload = function(){
    if(xhr1.status === 200) {
        let res = JSON.parse(xhr1.responseText)
        // console.log(res)
        let res1 = res.result
        console.log(res1)
        let lis =''


        res1.forEach(item => {
            lis += `
            <li>
                <a href="#">
                <div class="left">
                        ${item.couponProductImg}
                    </div>

                    <div class="right">
                        <div class="righttop">
                            <h4>${item.couponProductName}</h4>
                        </div>

                        <div class="rightbuttom">
                            <h4>${item.couponProductPrice}</h4>
                            <div>${item.couponProductTime}</div>
                        </div>
                    </div>
                </a>
            </li>
            `
            
        });
        ul.innerHTML = lis
    }
}
xhr1.send(null)